package migrations

import (
	"database/sql"

	"gitee.com/sweetsunnyflower/carpooling-server-go/app/models"
	"gitee.com/sweetsunnyflower/carpooling-server-go/pkg/migrate"

	"gorm.io/gorm"
)

func init() {

	type TransmissionType struct {
		models.BaseModel

		Name string `gorm:"type:varchar(100);comment:变速器类型名称;" db:"name" json:"name" form:"name"`

		models.CommonTimestampsField
	}

	up := func(migrator gorm.Migrator, DB *sql.DB) {
		migrator.AutoMigrate(&TransmissionType{})
	}

	down := func(migrator gorm.Migrator, DB *sql.DB) {
		migrator.DropTable(&TransmissionType{})
	}

	migrate.Add("2023_07_18_112107_add_transmission_types_table", up, down)
}
